import time

from machine import ADC, PWM, Pin

potentiometer = ADC(34)
ledPin = PWM(Pin(2))
ledPin.freq(50)

while True:
    value = potentiometer.read_u16()
    print(value)
    ledPin.duty_u16(value)
    time.sleep(0.5)
